{include file="layout/top"/}
<body class="hold-transition login-page admin-login-body-background" style="background-color:#00a6">
    
<script src="__STATIC__/module/admin/ext/background/login_background.js"></script>

<canvas></canvas>

<div class="admin-login-box">
  <div class="login-logo">
      <a href="" class="login-logo-a"><b>五域联盟</b></a>
  </div>
  <!-- /.login-logo -->
  <div class="login-box-body">
    <p class="login-box-msg">请输入您的登录信息</p>

    <form action="{:url('loginHandle')}" method="post" class="admin-login-form">
      <div class="form-group has-feedback">
          <input type="text" name="username" class="form-control" placeholder="请输入您的用户名">
           <span class="glyphicon glyphicon-user form-control-feedback"></span>
      </div>
      <div class="form-group has-feedback">
           <input type="password" name="password" class="form-control" placeholder="请输入您的密码">
           <span class="glyphicon glyphicon-lock form-control-feedback"></span>
      </div>
        
        <div>
            <img src="{:captcha_src()}" alt="captcha" class="admin-login-captcha-img captcha_change" id="captcha_img"/>
        </div>
        <br/>
      <div class="row" style="margin-bottom:15px">
        <div class="col-xs-8">
          <input type="text" name="verify" class="form-control verify" placeholder="请输入您的验证码">
          <span class="glyphicon glyphicon-open form-control-feedback admin-login-captcha-input-icon"></span>
        </div>
        <!-- /.col -->
        <div class="col-xs-4">
          <button type="button" class="btn btn-primary btn-block btn-flat captcha_change">换一张</button>
        </div>
        <!-- /.col -->
      </div>

        <!-- <div class="form-group has-feedback">
            <select name="phone" id="phone" class="form-control" >
                <option value="">请选择接收验证码手机号</option>
                {volist name='list' id='vo'}
                <option value="{$vo}">{$vo}</option>
                {/volist}
            </select>
        </div>
        <div class="row">
            <div class="col-xs-8">
                <input type="text" name="codes" class="form-control verify" placeholder="请输入手机验证码">
                <span class="glyphicon glyphicon-open form-control-feedback admin-login-captcha-input-icon"></span>
            </div>
            /.col
            <div class="col-xs-4">
                <button type="button" class="btn btn-primary btn-block btn-flat " id="sendMsg">发 送</button>
            </div>
            /.col
        </div> -->

        <div class="social-auth-links text-center">
          <button  type="submit" class="btn btn-block btn-facebook ladda-button login-submit-button" data-style="slide-up">
              <span class="ladda-label">登 录</span>
          </button>
          <!--<button  type="button" class="btn btn-block btn-google btn-flat">忘记密码</button>-->
        </div>
    </form>

    <!-- /.social-auth-links -->
    <!--<a href="#">找回密码</a><br>-->

  </div>
  <!-- /.login-box-body -->
</div>

<script>
   $("#sendMsg").click(function(){
        var phone=$("#phone option:selected").val();
       if($.trim(phone) == ''){
           layer.msg('请选择发送手机号');
           return false;
       }
       $.ajax({
           url: '{:url("send")}', //请求的url地址
           dataType: "json", //返回格式为json
           data:{
               phone:phone,
           },
           type: "POST", //请求方式
           success: function(res) {
               if(res.code==0){
                   layer.msg('验证码已发送！');
                   var time = 60;
                   $("#sendMsg").attr("disabled", true);
                   var timer = setInterval(function() {
                       if (time == 0) {
                           clearInterval(timer);
                           $("#sendMsg").attr("disabled", false);
                           $("#sendMsg").html("发 送");
                       } else {
                           $('#sendMsg').html(time + "s重新获取");
                           time--;
                       }
                   }, 1000);
               }else{
                   layer.msg(res.msg);
               }
           },
           error: function(rul) {
               console.log('网络出错')
           }
       });
   })

</script>

<!-- /.login-box -->
{include file="layout/bottom"/}